<template>
  <div class="xdata">
    <dnav :data="['数据分析', '消毒结果']" />
    <el-select v-model="ass_id" placeholder="请选择" @change="sel">
      <el-option
        v-for="item in xdasslist"
        :key="item.ass_id"
        :label="item.aname"
        :value="item.ass_id"
      >
        <span style="float: left">{{ item.aname }}</span>
        <span style="float: right; color: #8492a6; font-size: 13px">{{
          item.over_time
        }}</span>
      </el-option>
    </el-select>
    <el-divider content-position="left">消毒结果</el-divider>
    <el-card v-if="ass_id">
      <h3 class="h3">消毒结果</h3>
      <el-table :data="xdreslist" style="width: 100%">
        <el-table-column prop="wuname" label="检测对象" width="180">
        </el-table-column>
        <el-table-column prop="rname" label="科室" width="180">
        </el-table-column>
        <el-table-column prop="remark" label="备注"> </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ass_id: "",
      xdasslist: [], // 消毒任务列表
      xdreslist: [], // 消毒结果列表
    };
  },
  methods: {
    getxdass() {
      this.$api.Xdass().then((res) => {
        console.log(res);
        if (res.data.code == 200) {
          this.xdasslist = res.data.data;
        }
      });
    },
    sel() {
      this.$api.Xdres({ ass_id: this.ass_id }).then((res) => {
        console.log(res);
        if (res.data.code == 200) {
          this.xdreslist = res.data.data;
        }
      });
    },
  },
  mounted() {
    this.getxdass();
  },
};
</script>

<style scoped>
.h3 {
  height: 30px;
  background: gainsboro;
  border-left: 5px solid #409eff;
  line-height: 30px;
  padding-left: 10px;
}
</style>